/**
 *
 */
package cn.dw.sg.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.dw.sg.domain.Authority;
import cn.dw.sg.mapper.AuthorityMapper;
import cn.dw.sg.service.AuthorityService;

/**
 * @author aubrey
 * @date  上午9:31:41
 * 
 */
@Service("auService")
public class AuthorityServiceImpl implements AuthorityService {
	
	
//	@Resource
	@Autowired
	private AuthorityMapper authorityMapper ;
	
	
	
	public AuthorityMapper getAuthorityMapper() {
		return authorityMapper;
	}

	public void setAuthorityMapper(AuthorityMapper authorityMapper) {
		this.authorityMapper = authorityMapper;
	}

	@Transactional
	@Override
	public void add(Authority authority) {
		authorityMapper.add(authority);
		int i = 1/0;
	}

	@Override
	public void update(Authority authority) {
		authorityMapper.update(authority);

	}

	@Override
	public void delete(int id) {
		authorityMapper.delete(id);
	}

	@Override
	public List<Authority> query(Authority authority) {
		return authorityMapper.query(authority);
	}

}
